//引入路由对象
import {createRouter, createWebHistory, createWebHashHistory, createMemoryHistory, RouteRecordRaw} from 'vue-router'

//vue2 mode history vue3 createWebHistory
//vue2 mode  hash  vue3  createWebHashHistory
//vue2 mode abstact vue3  createMemoryHistory

// 路由配置数组
const routes: Array<RouteRecordRaw> = [
    {
        name: 'home',
        path: '/',
        component: () => import('@/views/index.vue'),
    },
    {
        name: 'login',
        path: '/login',
        component: () => import('@/views/login.vue')
    },
    {
        name: 'register',
        path: '/register',
        component: () => import('@/views/register.vue')
    },
    {
        name: 'editPassword',
        path: '/editPassword',
        component: () => import('@/views/edit-password.vue')
    },
];
// 项目路由对象
const router = createRouter({
    history: createWebHashHistory(),
    routes
})

// 导出
export default router;